Repository navigation
Publish on merge to main and move dist-tags through OIDC - #24
Merged
Merged
Conversation
- A push to main publishes when package.json has a version that isn't on npm yet, then creates the v<version> tag and a GitHub release with generated notes (a prerelease for next). Pushing tags no longer publishes, and a commit whose version is already on npm publishes nothing. - A manual run (workflow_dispatch with version and tag) points a dist-tag at a published version with npm trusted publishing, which npm supports for dist-tags since npm 12.2.0 when the trusted publisher allows it. The build is skipped for these runs. - README: how to release and how to move a dist-tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Releases now follow the Wechaty convention: merge a pull request that bumps the version, and CI publishes. Dist-tags can be moved without an npm token.
Changes
mainpublishes whenpackage.jsonhas a version that isn't on npm yet. It then creates thev<version>tag and a GitHub release with notes generated from the merged pull requests; anextrelease is marked as a prerelease. Pushing a tag no longer publishes, and a commit whose version is already on npm publishes nothing. The publish job getscontents: writefor the tag and release.gh workflow run ci.yml -f version=0.1.3 -f tag=latest, or the Actions tab) points a dist-tag at a published version through npm trusted publishing. npm has supported OIDC fornpm dist-tagsince npm 12.2.0 / 11.21.0, when the trusted publisher has Allow npm dist-tag enabled, which it does. The job checks that the version is on npm and accepts only plain version and tag names. The build is skipped for these runs.Before merging
The
npmenvironment only allowsv*tags today. Both jobs now run frommain, so addmainunder Settings → Environments → npm → Deployment branches and tags.After merging
Run
gh workflow run ci.yml -f version=0.1.3 -f tag=latestto movelatestoff 0.1.1, which can't be installed alongsidewechaty@next. The merge itself publishes nothing, because 0.1.3 is already on npm.Testing
npm view wechaty-puppet-neo@<version> versionwith npm 12.2.3: it prints0.1.3for a published version and nothing for 0.1.9. The step runs the check inside[ … ], sobash -edoesn't stop on the failed lookup.0.1.3/latestand0.1.3-rc.1/nextpass;1.2,Latest, and values containing;are rejected.🤖 Generated with Claude Code